<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    resolvef方法：讲一个普通的值转化为Promise类型的数据
    1.当resolve方法的参数为非Promise对象，则返回成功的Promise
    2.当resolve方法的参数为Promise对象，ze最终结果是参数Promise的状态跟结果
    <script>
    // 1.当resolve方法的参数为非Promise对象，则返回成功的Promise
        let p1 = Promise.resolve(123)
        console.log(p1);
        
        let p2 = Promise.resolve('123')
        console.log(p2);
        
        let p3 = Promise.resolve([1,2,3])
        console.log(p3);
        
        // 2.当resolve方法的参数为Promise对象，ze最终结果是参数Promise的状态跟结果
        let p4 = Promise.resolve(new Promise((resolve,reject)=>{
            resolve('yes')
        }))
        console.log(p4);
        let p5 = Promise.resolve(new Promise((resolve,reject)=>{
            reject('no')
        }))
        console.log(p5);
    </script>
</body>
</html>